package PTA3.ti40;

import java.util.Scanner;

/**
 * @author Lenovo
 */
class Student{
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        if(age<=6){
            this.age=7;
        }

    }
    public Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    public Student(){
        this("无名",7);
        System.out.println("无参构造方法");
    }
    public void display(){
        System.out.println("name:"+name+",age:"+age);
    }
}
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Student stu=new Student();
        String name= scanner.next();
        int age= scanner.nextInt();
        stu.display();
        stu.setAge(age);
        stu.setName(name);
        stu.display();
        scanner.close();
    }
}
